package org.zero.controller;

import com.alipay.api.AlipayApiException;
import com.fasterxml.jackson.core.JsonProcessingException;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.zero.model.AlipayRequest;
import org.zero.service.PayService;

/**
 * @author Zero (cnzeropro@qq.com)
 * @date 2021/10/5 18:35
 */
@RestController
@RequestMapping("order")
public class OrderController {
    @Resource
    private PayService payService;

    @PostMapping(value = "alipay")
    public String alipay(AlipayRequest alipayRequest) throws AlipayApiException, JsonProcessingException {
        return payService.alipay(alipayRequest);
    }
}
